const express = require('express'),
    bodyParser = require('body-parser'),
    cors = require('cors'),
    router = require('./router');

const port = 3001;
const app = express();

//跨域请求
app.use(cors());

app.use(bodyParser.json())

//转换数据
app.use(bodyParser.urlencoded({
    extended: false
}));
app.use(express.static(__dirname + '/public'))
app.use('/article', router)
app.listen(port)
console.log(`
    服务器启动成功：
     或者 http://192.168.0.103:3001
`)